package com.zzj.controller;


import com.zzj.ServiceImpl.DeptServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
//@CrossOrigin
@RequestMapping("dept")
public class DeptController {
    @Autowired
    private DeptServiceImpl service;
    @GetMapping("findAllDname")
    public List<String> findAllDname(){
        List<String> list = service.findAllDname();
        return list;
    }
    @GetMapping("assertDname")
    public boolean assertDname(int userId,String dname){
        boolean b = service.assertDname(userId, dname);
        return b;
    }

}
